﻿using System;
using System.Linq;
using System.Collections.Generic;

namespace HashFoo.Rest.Common
{
    /// <summary>
    /// Base implementation of <see cref="IQuery{TResultModel}"/>
    /// </summary>
    /// <typeparam name="TResultModel">The result model of the query.</typeparam>
    public abstract class QueryBase<TResultModel> : IQuery<TResultModel>
    {
        /// <summary>
        /// Creates a new, empty query.
        /// </summary>
        protected QueryBase()
        {
            QueryMeta = null;
        }

        /// <summary>
        /// Checks if the query has meta data.
        /// </summary>
        public bool HasQueryMeta
        {
            get { return QueryMeta != null; }
        }

        /// <summary>
        /// The meta data (paging, sorting, filtering) for the query.
        /// </summary>
        public QueryMeta QueryMeta
        {
            get; set;
        }
    }
}